
from django.db import models
from django.utils import timezone


class hoursDatas(models.Model):
    city_code = models.CharField(max_length=20)
    city_name = models.CharField(max_length=50)
    aqi = models.TextField()
    temperature = models.TextField()
    humidity = models.TextField()
    wind = models.TextField()
    create_time = models.DateTimeField(default=timezone.now)  # 设置当前时间

    class Meta:
        db_table = "weather_hours"


class todayDatas(models.Model):
    city_code = models.CharField(max_length=20)
    city_name = models.CharField(max_length=20)
    datas = models.TextField()
    create_time = models.DateTimeField(default=timezone.now)  # 设置当前时间

    class Meta:
        db_table = "weather_today"

class cityCodes(models.Model):
    all_code = models.TextField()

    class Meta:
        db_table = "city_codes"